/**
 * Created by 55456 on 2016/5/15.
 */
var express = require("express");
var expressValidator = require('express-validator');
var bodyParser = require('body-parser');
var app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.use(expressValidator());

app.locals.session = [];

module.exports = app;
var auth = require("./auth.js");

app.use(function(req,res,next){
    //auth user
    //var user = auth.user(this);
    //if ...
    next();
});

require("./router")(app);

app.listen(3000);